import request from '@/utils/request'

export function getSourceList() {
  return request({
    url: '/system/metadata/source/getSourceList',
    method: 'get'
  })
}

export function queryTableList(id) {
  return request({
    url: '/system/job/metadataJob/queryTableList/' + id,
    method: 'get'
  })
}
export function queryColumnList(id) {
  return request({
    url: '/system/job/metadataJob/queryColumnList/' + id,
    method: 'get'
  })
}

export function queryRules() {
  return request({
    url: '/system/rules/metadataRules/nameList',
    method: 'get'
  })
}
//获取任务表列表数据
export function fetchmetadataJobList(data) {
  return request({
    url: '/system/job/metadataJob/getList',
    method: 'get',
    params: data
  })
}

export function getmetadataJob(id) {
  return request({
    url: '/system/job/metadataJob/queryById/' + id,
    method: 'get'
  })
}

export function createmetadataJob(data) {
  return request({
    url: '/system/job/metadataJob/add',
    method: 'post',
    data
  })
}

export function updatemetadataJob(data) {
  return request({
    url: '/system/job/metadataJob/update',
    method: 'post',
    data
  })
}

export function deletemetadataJob(ids) {
  return request({
    url: '/system/job/metadataJob/delete',
    method: 'post',
    data: { ids }
  })
}
//开始停止
export function changeJobStatus(data) {
  return request({
    url: '/system/job/metadataJob/changeJobStatus' ,
    method: 'post',
    data
  })
}
//刷新
export function refresh() {
  return request({
    url: '/system/job/metadataJob/refreshJob' ,
    method: 'post'
  })
}
//执行一次
export function startOne(data) {
  return request({
    url: '/system/job/metadataJob/runAJobNow' ,
    method: 'post',
    data
  })
}

